<div class="tableform">
    
<{if $finance_installed=='yes'}>
    <div class="division">
        <div class="subtitle">账期设置</div>
        <div class="subblock">
            <table cellspacing="0" cellpadding="0" border="0">
                <tr><th>设置账期：&nbsp;&nbsp;</th>
                    <td>
                       <input type='radio' class='on-off-cost-init_time' name='set[ome.finance.set]' <{if $finance_set=='on'}>checked<{/if}> value='on'>开启
                       <input type='radio' class='on-off-cost-init_time' name='set[ome.finance.set]' <{if $finance_set=='off' || $finance_set==''}>checked<{/if}> value='off'>关闭
                        
               
                <!--子部分E-->
                    </td>
                </tr>
                <tr class="subpart">
                        <th>账务起始日：</th>
                        <td><{if $tyear}><{$tyear}>年<{$tmonth}>月<{/if}><{input type="select" id="init_time" name="init_time[day]" options=$day value=$init_time.day}><span class="nt">起始年、月，默认取当前时间前一个月</span></td>
                        <{input type="hidden" name="init_time[year]" value=$tyear}>
                        <{input type="hidden" name="init_time[month]"  value=$tmonth}>
                    </tr>
                
            </table>
            
        </div>
       
        <div class='notice'>
                初始化设置完成后，有数据进入系统，则不能修改！必须清空所有数据才能再次修改！<br/><br/>
                <span style='color:red;'>注意：受支付宝流水接口影响，只能获取近一个月的流水！</span>
            </div>
    </div>
    <script type="text/javascript" charset="utf-8">
        
    var finance_set= $$('input[name=set[ome.finance.set]]:checked').get('value');

    finance_show(finance_set);
    function finance_show(value){

        if(value == 'on'){
            $$('.subpart').setStyle('display','');
        }else{
            
            $$('.subpart').setStyle('display','none');
        }
    }
    $$('.on-off-cost-init_time').addEvent('click',function(e){
        var value = $$('input[name=set[ome.finance.set]]:checked').get('value');
        if(value=='off' && '<{$finance_set}>'=='on'){
            alert('账期设置开启不能关闭');
           return false;
        }
        finance_show(value);


    });
    var init_time = '<{$init_time.day}>';
    if(init_time){
        $('init_time').set('disabled',true);
    }
    </script>
    <{/if}>
</div>
